package com.jsgt.greekfire.dao.dao

import androidx.lifecycle.LiveData
import androidx.room.*
import com.jsgt.greekfire.dao.model.ContactAddress

@Dao
interface AddressDao {
    @Query("select * from address")
    fun get(): LiveData<List<ContactAddress>>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun add(address:ContactAddress)

    @Delete
    fun delete(address:ContactAddress)

    @Query("delete from address where id = :id")
    fun delete(id:Int)

    @Update
    fun update(address: ContactAddress)
}